<!DOCTYPE html>
<!--suppress ThymeleafVariablesResolveInspection -->
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta charset="UTF-8">
    <title>Title</title>
    <link th:href="@{/local/css/login.css}" rel="stylesheet">
    <link  th:href="@{/local/css/page.css}"  rel="stylesheet">
</head>
<body>
<div th:fragment="myPage(pageInfo,path)">
    <div class="">
        当前第 <span th:text="${pageInfo.pageNum}"></span> 页，
        共 <span th:text="${pageInfo.pages}"></span> 页，
        <span th:text="${pageInfo.total}"></span> 条记录
    </div>
    <ul class="pagelist" style="list-style: none">

        <li th:if="${pageInfo.hasPreviousPage}"}><!--hasPreviousPage默认值为false， 如果有上一页，则不显示首页-->
            <a th:href="@{/admin/}+${path}+'?pageNum=1'">首页</a>&nbsp;
        </li>
        <li th:if="${pageInfo.hasPreviousPage}"><!--hasPreviousPage默认值为false， 如果有上一页，则不显示-->
            <a th:href="@{/admin/}+${path}+ '?pageNum='+${pageInfo.prePage}">上一页</a>&nbsp;
        </li>
        <li th:each="nav:${pageInfo.navigatepageNums}"><!--navigatepageNums是一个数组：遍历所有导航页号。 -->
            <a th:href="@{/admin/}+${path}+'?pageNum='+${nav}" th:text="${nav}" th:if="${nav != pageInfo.pageNum}"></a><!--如果不是当前页则可以跳转其他页面。遍历展示-->
            <a th:class="${'active'}" th:if="${nav == pageInfo.pageNum}" th:text="${nav}"></a><!--如果是当前页则有样式。遍历 展示-->
            &nbsp;</li>
        <li th:if="${pageInfo.hasNextPage}"><!--hasNextPage默认值为false， 如果没有下一页，则不显示-->
            <a th:href="@{/admin/}+${path}+'?pageNum='+${pageInfo.nextPage}">下一页</a>&nbsp;
        </li>
        <li th:if="${pageInfo.pageNum < pageInfo.pages}"><!--如果当前页小于总页数则不显示尾页 -->
            <a th:href="@{/admin/}+${path}+'?pageNum='+${pageInfo.pages}">尾页</a>
        </li>
    </ul>
</div>
</body>
</html>